PWD = $(shell pwd)
KERNEL_DIR ?=$(PWD)/../../linux
OUT = $(PWD)/../bin


CC = aarch64-buildroot-linux-gnu-gcc
LD = aarch64-buildroot-linux-gnu-ld


obj-m += exporter-fd.o importer-fd.o

PHONY += kernel_modules
kernel_modules:
	$(MAKE) ARCH=arm64 CROSS_COMPILER=$(CC) -C $(KERNEL_DIR) M=$(PWD) modules
	cp *.ko  $(OUT)

PHONY += clean
clean:
	$(MAKE) ARCH=arm64 CROSS_COMPILER=$(CC) -C $(KERNEL_DIR) M=$(PWD) clean
	rm -rf $(OUT)/*